{extend name="base/form_base" /}
{block name="style"}
<style type="text/css">

</style>
{/block}
{block name="content"}
<div class="layui-fluid">
<form class="layui-form" id='edit_form' onsubmit="return false">
  <input type="hidden" name="id" value="{$data['id']}" >
  <input type="hidden" name="qwerty" value="1" >
<!--   <blockquote class="layui-elem-quote"></blockquote> -->
  <div class="layui-row">
    <div class="layui-col-md6">
        <div class="layui-form-item">
            <label class="layui-form-label">当前状态：</label>
            <div class="layui-input-inline">
              <input type="text" value="{$data.remark}" class="layui-input" readonly="readonly">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">真实姓名：</label>
            <div class="layui-input-inline">
              <input type="text" value="{$data.real_name ?? ''}" class="layui-input" readonly="readonly">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">正面：</label>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-inline">
              <img src="{$data.idcard_front ?? ''}">
            </div>
        </div>
    </div>
    <div class="layui-col-md6">
        <div class="layui-form-item">
            <label class="layui-form-label">审核状态：</label>
            <div class="layui-input-inline">
              <select name="identity_status" required="required" lay-verify="required" lay-search="" id='identity_status'>
                <option value="">请审核认证状态</option>
                <option value="0">未认证</option>
                <option value="1">待认证</option>
                <option value="2">认证通过</option>
                <option value="3">认证失败</option>
              </select>
            </div>
            <div class="layui-input-inline" style="width: 80px">
              <button class="layui-btn" onclick="ajax()" lay-filter="formDemo">确定 </button>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">账号：</label>
            <div class="layui-input-inline">
              <input type="text" value="{$data.idcard_no ?? ''}" class="layui-input" readonly="readonly">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">反面：</label>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-inline">
              <img src="{$data.idcard_back ?? ''}">
            </div>
        </div>
    </div>
  </div>
</form>
</div>  
{/block}
{block name="script"}
<script type="text/javascript">
  function ajax(){
    var identity_status = $("#identity_status").val();
    if(identity_status == ''){
      layer.msg('请选择审核状态');
      return;
    }
    var post_data = $('#edit_form').serialize();
    $.ajax({
            url:"{:url('admin/index/editForm')}",
            type:"POST",
            data:post_data,
            success:function(ret){
                if (ret.code == 0) {
                  layer.msg('操作成功');
                  location.reload();
                  parent.$(".layui-laypage-btn")[0].click();
                }
                if (ret.code == 1) {
                    layer.msg(ret.msg);
                }
            }
        });
  }
</script> 
{/block}